package com.headfirst.factory.simplefactory;

/**
 * 创建PizzaStore对象时，需要给PizzaStore传递一个SimplePizzaFactory工厂，PizzaStore需要什么类型的
 * Pizza，就交给这个披萨工厂进行创建。
 * @author sunhongguang
 * @create 2022-01-23-18:53
 */
public class PizzaStore {
    
    public Pizza orderPizza(String type){
        Pizza pizza;
        pizza = SimplePizzaFactory.createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }
}
